home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsIRDFContainer.idl < prev    next >
Text File  |  2006-05-08  |  5KB  |  127 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  26.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. #include "nsISupports.idl"
  39. #include "nsIRDFDataSource.idl"
  40. #include "nsIRDFResource.idl"
  41. #include "nsIRDFNode.idl"
  42. #include "nsISimpleEnumerator.idl"
  43.  
  44. // A wrapper for manipulating RDF containers
  45. [scriptable, uuid(D4214E90-FB94-11D2-BDD8-00104BDE6048)]
  46. interface nsIRDFContainer : nsISupports {
  47.     readonly attribute nsIRDFDataSource DataSource;
  48.     readonly attribute nsIRDFResource   Resource;
  49.  
  50.     /**
  51.      * Initialize the container wrapper to the specified resource
  52.      * using the specified datasource for context.
  53.      */
  54.     void Init(in nsIRDFDataSource aDataSource, in nsIRDFResource aContainer);
  55.  
  56.     /**
  57.      * Return the number of elements in the container. Note that this
  58.      * may not always be accurate due to aggregation.
  59.      */
  60.     long GetCount();
  61.  
  62.     /**
  63.      * Return an enumerator that can be used to enumerate the contents
  64.      * of the container in ascending order.
  65.      */
  66.     nsISimpleEnumerator GetElements();
  67.  
  68.     /**
  69.      * Append an element to the container, assigning it the next
  70.      * available ordinal.
  71.      */
  72.     void AppendElement(in nsIRDFNode aElement);
  73.  
  74.     /**
  75.      * Remove the first occurence of the specified element from the
  76.      * container. If aRenumber is 'true', then the underlying RDF graph
  77.      * will be 're-numbered' to account for the removal.
  78.      */
  79.     void RemoveElement(in nsIRDFNode aElement, in boolean aRenumber);
  80.  
  81.     /**
  82.      * Insert aElement at the specified index. If aRenumber is 'true', then
  83.      * the underlying RDF graph will be 're-numbered' to accomodate the new
  84.      * element.
  85.      */
  86.     void InsertElementAt(in nsIRDFNode aElement, in long aIndex, in boolean aRenumber);
  87.  
  88.     /**
  89.      * Remove the element at the specified index. If aRenumber is 'true', then
  90.      * the underlying RDF graph will be 're-numbered' to account for the
  91.      * removal.
  92.      *
  93.      * @return the element that was removed.
  94.      */
  95.     nsIRDFNode RemoveElementAt(in long aIndex, in boolean aRenumber);
  96.  
  97.     /**
  98.      * Determine the index of an element in the container.
  99.      *
  100.      * @return The index of the specified element in the container. If
  101.      * the element is not contained in the container, this function
  102.      * returns '-1'.
  103.      */
  104.     long IndexOf(in nsIRDFNode aElement);
  105. };
  106.  
  107. %{C++
  108. nsresult
  109. NS_NewRDFContainer(nsIRDFContainer** aResult);
  110.  
  111. nsresult
  112. NS_NewRDFContainer(nsIRDFDataSource* aDataSource,
  113.                    nsIRDFResource* aResource,
  114.                    nsIRDFContainer** aResult);
  115.  
  116. /**
  117.  * Create a cursor on a container that enumerates its contents in
  118.  * order
  119.  */
  120. nsresult
  121. NS_NewContainerEnumerator(nsIRDFDataSource* aDataSource,
  122.                           nsIRDFResource* aContainer,
  123.                           nsISimpleEnumerator** aResult);
  124.  
  125.  
  126. %}
  127.